import service from '@/utils/request'

//系统角色列表
export const getRoleListRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getRoleList',
        data
    })
}

//修改角色状态
export const modifyRoleStatusRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/modifyRoleStatus',
        data
    })
}

//删除角色
export const deleteRoleRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/deleteRole',
        data
    })
}

//查询菜单权限
export const getMenuPermissionListRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getMenuPermissionList',
        data
    })
}

//查询按钮权限
export const getButtonPermissionListRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getButtonPermissionList',
        data
    })
}

//新增/修改角色
export const saveRoleRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/saveRole',
        data
    })
}

//获取用户列表
export const getUserListRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getUserList',
        data
    })
}

//获取用户类型列表
export const getRoleSelectListRequest = () => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getRoleSelectList'
    })
}


//删除用户
export const deleteUserRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/deleteUser',
        data
    })
}

//冻结用户/解冻
export const freezeOrThawUserRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/freezeOrThawUser',
        data
    })
}

//清空用户内存
export const clearUserSpaceRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/clearUserSpace',
        data
    })
}

//修改用户角色
export const adjustUserRoleRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/adjustUserRole',
        data
    })
}

//调整用户可用内存大小
export const adjustUserSpaceRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/adjustUserSpace',
        data
    })
}

//查询操作日志
export const getOperateLogListRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getOperateLogList',
        data
    })
}

//查询操作类型
export const getOperateTypeListRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/getOperateTypeList',
        data
    })
}

//查询权限
export const pagePermissionRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/pagePermission',
        data
    })
}

//新增权限
export const addPermissionRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/addPermission',
        data
    })
}

//修改权限
export const modifyPermissionRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/modifyPermission',
        data
    })
}

//删除权限
export const deletePermissionRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/deletePermission',
        data
    })
}

//新增编辑用户
export const saveUserRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/saveUser',
        data
    })
}

//获取任务页面列表
export const getTaskPageListRequest = data => {
    return service({
        method: 'post',
        url: '/taskManage/getTaskPageList',
        data
    })
}

//分页查询任务列表
export const pageSearchTaskRequest = data => {
    return service({
        method: 'post',
        url: '/taskManage/pageSearchTask',
        data
    })
}

//终止任务
export const stopTaskRequest = data => {
    return service({
        method: 'post',
        url: '/taskManage/stopTask',
        data
    })
}

//删除任务
export const removeDrawTaskRequest = data => {
    return service({
        method: 'post',
        url: '/taskManage/removeDrawTask',
        data
    })
}

//显示隐藏任务
export const hideOrShowDrawTaskRequest = data => {
    return service({
        method: 'post',
        url: '/taskManage/hideOrShowDrawTask',
        data
    })
}

//查询已分享的用户
export const getHasShareUserListRequest = data => {
    return service({
        method: 'post',
        url: '/personCenter/getHasShareUserList',
        data
    })
}

//修改已分享的用户
export const modifyShareUserRequest = data => {
    return service({
        method: 'post',
        url: '/personCenter/modifyShareUser',
        data
    })
}

//修改要分享的用户
export const searchShareUserInfoRequest = data => {
    return service({
        method: 'post',
        url: '/personCenter/searchShareUserInfo',
        data
    })
}

//一键清理
export const cleanInactiveUserSpaceRequest = data => {
    return service({
        method: 'post',
        url: '/userPermissionManage/cleanInactiveUserSpace',
        data
    })
}

//分页查询项目管理列表
export const pageProjectManageRequest = data => {
    return service({
        method: 'post',
        url: '/projectManage/pageProjectManage',
        data
    })
}

// 导入项目
export const importProjectRequest = data => {
    return service({
        method: 'post',
        headers: { 'Content-Type': 'multipart/form-data' },
        url: `/projectManage/importProject`,
        data,
    })
}

// 查询项目客户下拉框
export const getProjectContactsSelectRequest = data => {
    return service({
        method: 'post',
        url: `/projectManage/getProjectContactsSelect`,
        data,
    })
}


// 修改项目管理
export const modifyProjectManageRequest = data => {
    return service({
        method: 'post',
        url: `/projectManage/modifyProjectManage`,
        data,
    })
}

// 删除项目管理
export const deleteProjectManageRequest = projectManageId => {
    return service({
        method: 'post',
        url: `/projectManage/deleteProjectManage/${projectManageId}`,
    })
}

// 搜索合同编号
export const searchProjectNoRequest = data => {
    return service({
        method: 'post',
        url: `/projectManage/searchProjectNo`,
        data
    })
}

// 查询可选择的服务器下拉框
export const getServerSelectRequest = data => {
    return service({
        method: 'post',
        url: `/projectManage/getServerSelect`,
        data
    })
}

// 查询传输进度
export const getTransferProgressRequest = data => {
    return service({
        method: 'post',
        url: `/projectManage/getTransferProgress`,
        data
    })
}

// 指定项目路径
export const assignProjectPathRequest = data => {
    return service({
        method: 'post',
        url: `/projectManage/assignProjectPath`,
        data
    })
}

// 任务量统计
export const taskAmountStatisticRequest = data => {
    return service({
        method: 'post',
        url: `/taskAmountStatistic`,
        data
    })
}

// 用户使用统计
export const usageStatisticRequest = data => {
    return service({
        method: 'post',
        url: `/usageStatistic`,
        data
    })
}

// 查看用户绘图统计详情
export const viewUserDrawStatisticDetailRequest = data => {
    return service({
        method: 'post',
        url: `/viewUserDrawStatisticDetail`,
        data
    })
}

// 工具使用统计
export const toolUseStatisticRequest = data => {
    return service({
        method: 'post',
        url: `/toolUseStatistic`,
        data
    })
}

// 搜索绘图用户
export const searchDrawUserRequest = data => {
    return service({
        method: 'post',
        url: `/searchDrawUser`,
        data
    })
}

// 下载任务量统计
export const downloadTaskAmountStatisticRequest = data => {
    return service({
        method: 'post',
        url: `/downloadTaskAmountStatistic`,
        data,
        responseType: 'arraybuffer'
    })
}

// 下载用户使用统计
export const downloadUsageStatisticRequest = data => {
    return service({
        method: 'post',
        url: `/downloadUsageStatistic`,
        data,
        responseType: 'arraybuffer'
    })
}

// 下载工具使用统计
export const downloadToolUseStatisticRequest = data => {
    return service({
        method: 'post',
        url: `/downloadToolUseStatistic`,
        data,
        responseType: 'arraybuffer'
    })
}
